from alg import *
from gen import *

class Test(Solution):
    def testing(self, test_list : list):
        res = list()

        for s in test_list:
            r = Solution.restoreIpAddresses(self, s)
            res.append(r)
        
        print("{}".format("".rjust(50, '-')))
        for i in range(len(test_list)):
            print("test No.{}:".format(i+1))
            print("test str  |  '{}'".format(test_list[i]))
            print("result    |  {}".format(res[i][0]))
            print("time cost |  {:.3f} ms".format(res[i][1]))
            print("{}".format("".rjust(50, '-')))


if __name__ == '__main__':
    t = Test()
    gen = Generator()
    test_list = gen.gen(5)
    t.testing(test_list)